package com.mkuspis.moviebrowser;

import android.app.Application;

import com.mkuspis.moviebrowser.datamanagment.Utils;
import com.mkuspis.moviebrowser.datamanagment.datamanagers.MovieDetailsDataManager;
import com.mkuspis.moviebrowser.datamanagment.datamanagers.MovieListDataManager;
import com.mkuspis.moviebrowser.datamanagment.internetutils.HttpApiClient;
import com.mkuspis.moviebrowser.datamanagment.orm.DatabaseHelper;
import com.mkuspis.moviebrowser.preferences.PreferencesEditor;

/**
 * Application class.
 */
public class MovieBrowserApplication extends Application {

    private MovieListDataManager movieListDataManager;
    private MovieDetailsDataManager movieDetailsDataManager;
    private Utils utils;
    private DatabaseHelper databaseHelper;
    private PreferencesEditor preferencesEditor;
    private HttpApiClient httpApiClient;

    @Override
    public void onCreate() {
        super.onCreate();

        databaseHelper = new DatabaseHelper(this);
        utils = new Utils(this);

        movieListDataManager = new MovieListDataManager(this);
        movieDetailsDataManager = new MovieDetailsDataManager(this);
        preferencesEditor = new PreferencesEditor(this);
        httpApiClient = new HttpApiClient(this);
    }

    public MovieListDataManager getMovieListDataManager() {
        return movieListDataManager;
    }

    public MovieDetailsDataManager getMovieDetailsDataManager() {
        return movieDetailsDataManager;
    }

    public Utils getUtils() {
        return utils;
    }

    public DatabaseHelper getDatabaseHelper() {
        return databaseHelper;
    }

    public PreferencesEditor getPreferencesEditor() {
        return preferencesEditor;
    }

    public HttpApiClient getHttpApiClient() {
        return httpApiClient;
    }
}